// *** ADDED BY HEADER FIXUP ***
#include <wx/string.h>
// *** END ***
#ifndef LOGINSET_H_INCLUDED
#define LOGINSET_H_INCLUDED

#include <set>
#include <string>
#include <wx/thread.h>
using namespace std;
class LoginSet
{
private:
	wxMutex mutex;
	set<wxString> nameSet;
public:
	bool Login(const wxString& name)
	{
		wxMutexLocker locker(mutex);
		if(nameSet.find(name)!=nameSet.end()) return false;
		else nameSet.insert(name);
		return true;
	}
	bool LogOut(const wxString& name)
	{
		wxMutexLocker locker(mutex);
		if(nameSet.find(name)==nameSet.end()) return false;
		else nameSet.erase(name);
		return true;
	}
};

#endif // LOGINSET_H_INCLUDED
